package com.rabbiter.ordering.service;

import com.rabbiter.ordering.entity.CategorySalesDTO;
import com.rabbiter.ordering.entity.FullReportDTO;
import com.rabbiter.ordering.entity.MonthlySalesDTO;
import com.rabbiter.ordering.mapper.OrderItemMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class ReportService{

    @Autowired
    private OrderItemMapper orderItemMapper;


    public List<CategorySalesDTO> getSalesByCategory(Date startDate, Date endDate) {
        return orderItemMapper.selectSalesByCategory(startDate, endDate);
    }


    public List<MonthlySalesDTO> getSalesByMonth(Date startDate, Date endDate) {
        return orderItemMapper.selectSalesByMonth(startDate, endDate);
    }


    public List<FullReportDTO> getFullReport(Date startDate, Date endDate, String status) {
        return orderItemMapper.selectFullReport(startDate, endDate, status);
    }
}